<template>
    <div>
        <van-tabbar v-model="active">
            <van-tabbar-item replace to="/mIndex" icon="home-o" @click="changeCurrentTabBar">首页</van-tabbar-item>
            <van-tabbar-item replace to="/mCourseList" icon="apps-o" @click="changeCurrentTabBar">教程</van-tabbar-item>
            <van-tabbar-item replace to="/mUserCenter" icon="user-circle-o" @click="changeCurrentTabBar">我的</van-tabbar-item>
        </van-tabbar>
    </div>
</template>

<script>
    export default {
        name: "MymNavBar",
        data(){
            return{
                active: this.$store.state.currentTabBarActiveIndex
            }
        },
        methods:{
            changeCurrentTabBar(){
                //console.log('change active Index....');
                this.$store.dispatch("actionSetCurrentTabBarActiveIndex",this.active);
            }
        }
    }
</script>

<style scoped>

</style>